package com.xpgk.mvc.loseWeightCustomerRanking;

import java.util.List;

import com.jfinal.log.Log;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.xpgk.annotation.Service;
import com.xpgk.mvc.base.BaseService;


@Service(name = LoseWeightCustomerRankingService.serviceName)
public class LoseWeightCustomerRankingService extends BaseService{

	@SuppressWarnings("unused")
	private static final Log log = Log.getLog(LoseWeightCustomerRankingService.class);
	public static final String serviceName = "loseWeightCustomerRankingService";
	
	
	/*
	 * 顾客数据查询
	 */
	public List<Record> customerDataQuery(String organIdsEmployee,String date,String hybh,String customerName,String customerPhone) {
		String sql = getSqlMy(LoseWeightCustomerRankingSQL.loseweightcustomerranking_querycustomerdata);
		
		List<Record> result =Db.find(sql,organIdsEmployee,date);
		for(int i=0;i<result.size();i++){
			result.get(i).set("paiming", i+1);
//			if(result.get(i).getStr("isshaping").equals("1")){
//				if(result.get(i).get("valueee")!=null){
//					result.get(i).set(result.get(i).get("valueee").toString(), result.get(i).get("keyyy").toString());
				}
//			}
//		}
		return result;
	}
	/*
	 * 查询产品信息
	 */
	public List<Record> productData(){
		String sql = "SELECT ids,`name`,useIds FROM sb_product WHERE useIds='f251248c324f436c8b8ff21a4a06bbc1'";
		List<Record> serviceproducts = Db.find(sql);
		return serviceproducts;
	}
}
